home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
-
- main(argc,argv)
- int argc;
- char **argv;
- {
- FILE * infile,* outfile;
- char a;
-
- infile=stdin;
- outfile=stdout;
-
- if (argc>3) {fprintf(stderr,"Too many arguments.\n");exit(200);}
- if (argc==3) outfile=fopen(argv[2],"w");
- if (argc>=2) infile=fopen(argv[1],"r");
- while (!feof(infile))
- {a=getc(infile);
- if (a==10) putc(13,outfile);
- putc(a,outfile);
- }
- fclose(outfile);
- fclose(infile);
- }
-